Optimal. Leaf size=69 \[ -\frac{b^2 B \log (a \cos (c+d x)+b \sin (c+d x))}{a d \left (a^2+b^2\right )}-\frac{b B x}{a^2+b^2}+\frac{B \log (\sin (c+d x))}{a d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0854284, antiderivative size = 69, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 32, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.125, Rules used = {21, 3571, 3530, 3475} \[ -\frac{b^2 B \log (a \cos (c+d x)+b \sin (c+d x))}{a d \left (a^2+b^2\right )}-\frac{b B x}{a^2+b^2}+\frac{B \log (\sin (c+d x))}{a d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 21
Rule 3571
Rule 3530
Rule 3475
Rubi steps
\begin{align*} \int \frac{\cot (c+d x) (a B+b B \tan (c+d x))}{(a+b \tan (c+d x))^2} \, dx &=B \int \frac{\cot (c+d x)}{a+b \tan (c+d x)} \, dx\\ &=-\frac{b B x}{a^2+b^2}+\frac{B \int \cot (c+d x) \, dx}{a}-\frac{\left (b^2 B\right ) \int \frac{b-a \tan (c+d x)}{a+b \tan (c+d x)} \, dx}{a \left (a^2+b^2\right )}\\ &=-\frac{b B x}{a^2+b^2}+\frac{B \log (\sin (c+d x))}{a d}-\frac{b^2 B \log (a \cos (c+d x)+b \sin (c+d x))}{a \left (a^2+b^2\right ) d}\\ \end{align*}
Mathematica [C] time = 0.113865, size = 79, normalized size = 1.14 \[ -\frac{B \left (2 b^2 \log (a \cot (c+d x)+b)+a (a+i b) \log (-\cot (c+d x)+i)+a (a-i b) \log (\cot (c+d x)+i)\right )}{2 a d \left (a^2+b^2\right )} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.089, size = 99, normalized size = 1.4 \begin{align*} -{\frac{\ln \left ( 1+ \left ( \tan \left ( dx+c \right ) \right ) ^{2} \right ) aB}{2\,d \left ({a}^{2}+{b}^{2} \right ) }}-{\frac{B\arctan \left ( \tan \left ( dx+c \right ) \right ) b}{d \left ({a}^{2}+{b}^{2} \right ) }}+{\frac{B\ln \left ( \tan \left ( dx+c \right ) \right ) }{ad}}-{\frac{{b}^{2}\ln \left ( a+b\tan \left ( dx+c \right ) \right ) B}{ad \left ({a}^{2}+{b}^{2} \right ) }} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.52219, size = 119, normalized size = 1.72 \begin{align*} -\frac{\frac{2 \, B b^{2} \log \left (b \tan \left (d x + c\right ) + a\right )}{a^{3} + a b^{2}} + \frac{2 \,{\left (d x + c\right )} B b}{a^{2} + b^{2}} + \frac{B a \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{2} + b^{2}} - \frac{2 \, B \log \left (\tan \left (d x + c\right )\right )}{a}}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.78834, size = 242, normalized size = 3.51 \begin{align*} -\frac{2 \, B a b d x + B b^{2} \log \left (\frac{b^{2} \tan \left (d x + c\right )^{2} + 2 \, a b \tan \left (d x + c\right ) + a^{2}}{\tan \left (d x + c\right )^{2} + 1}\right ) -{\left (B a^{2} + B b^{2}\right )} \log \left (\frac{\tan \left (d x + c\right )^{2}}{\tan \left (d x + c\right )^{2} + 1}\right )}{2 \,{\left (a^{3} + a b^{2}\right )} d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.24427, size = 124, normalized size = 1.8 \begin{align*} -\frac{\frac{2 \, B b^{3} \log \left ({\left | b \tan \left (d x + c\right ) + a \right |}\right )}{a^{3} b + a b^{3}} + \frac{2 \,{\left (d x + c\right )} B b}{a^{2} + b^{2}} + \frac{B a \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{2} + b^{2}} - \frac{2 \, B \log \left ({\left | \tan \left (d x + c\right ) \right |}\right )}{a}}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]